package com.kzy.demoadmin.web.mapper;


import com.kzy.demoadmin.web.entity.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NoticeMapper {
    /**
     * 根据id查询公告
     * @param integer
     * @return
     */
    @Select("select * from Notice where id=#{id}")
    Notice findById(@Param("id") Integer integer);

    /**
     * 分页查询
     * @param notice
     * @return
     */
    List<Notice> searchBy(Notice notice);

    /**
     * 删除公告
     * @param id
     * @return
     */
    @Delete("delete from Notice where id=#{id}")
    int deleteById(Integer id);

    /**
     * 新增公告
     * @param notice
     */
    void insert(Notice notice);

    /**
     * 修改公告
     * @param notice
     */
    void update(Notice notice);
}
